import { FormProps, FormSchema } from '/@/components/Form';
import moment from 'moment';
import type { DynamicProps } from '/#/utils';
import utils from '../../../utils/utils.js';
type Props = Partial<DynamicProps<FormProps>>;
import { LogOption } from '/@/enums/dateTypeEnum';
export const searchSchemas: FormSchema[] = [
  {
    field: 'time',
    component: 'RangePicker',
    label: '日期时间',
    defaultValue: [
      moment(utils.getCurrentTime()).format('YYYY/MM/DD HH:mm'),
      moment(utils.getCurrentTime()).format('YYYY/MM/DD') + ' 23:59:59',
    ],
    componentProps: () => {
      return {
        showTime: true,
      };
    },
    colProps: {
      span: 8,
    },
  },
  {
    field: 'log_type',
    component: 'Select',
    label: '日志类型',
    defaultValue: 'recv',
    componentProps: {
      placeholder: '请选择',
      options: LogOption,
    },
    colProps: {
      span: 5,
    },
  },
];

export const fromConfig: Props = {
  labelWidth: 90,
  schemas: searchSchemas,
  showActionButtonGroup: false,
  actionColOptions: {
    span: 24,
  },
};
